﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint;

namespace UE.SharePoint.ImportExport.BLL
{
    /// <summary>
    /// Represents a setting of context
    /// </summary>
    public class Setting
    {
        /// <summary>
        /// Gets or Sets file name
        /// </summary>
        public string FileName { get; set; }

        /// <summary>
        /// Gets file ext
        /// </summary>
        public string FileExt
        {
            get
            {
                return FileName.Substring(FileName.IndexOf(".") + 1);
            }
        }

        /// <summary>
        /// Gets or Sets folder is a sharepoint file
        /// </summary>
        public bool IsSPFile { get; set; }

        /// <summary>
        /// Gets or Sets folder url of current sharepoint,that represents a file address
        /// </summary>
        public string SPFolderUrl { get; set; }

        /// <summary>
        /// Gets or Sets site of current sharepoint
        /// </summary>
        public SPSite SPSite { get; set; }

        /// <summary>
        /// Get or Sets zone of current sharepoint
        /// </summary>
        public SPUrlZone Zone { get; set; }

        /// <summary>
        /// Gets or Sets web of current sharepoint 
        /// </summary>
        public SPWeb SPWeb { get; set; }

        /// <summary>
        /// Gets or Sets list of current sharepoint 
        /// </summary>
        public SPList SPList { get; set; }

        private int _startRow = 1;
        /// <summary>
        /// Gets or Sets start row of current splist when import
        /// </summary>
        public int StartRow
        {
            get { return _startRow; }
            set { _startRow = value; }
        }

        /// <summary>
        /// Gets or Sets memorystream when export
        /// </summary>
        public MemoryStream ResponseMemory { get; set; }

        private bool _isContainAdditionalColumn = true;
        /// <summary>
        /// Gets or Sets current splist is contain additional column when export
        /// </summary>
        public bool IsContainAdditionalColumn
        {
            get{return _isContainAdditionalColumn;}
            set { _isContainAdditionalColumn = value; }
        }

        /// <summary>
        /// Gets or Sets 
        /// </summary>
        public string Query { get; set; }
    }
}
